<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>合作商表</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../public/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../public/css/font-awesome.min.css">
    <link rel="stylesheet" href="../../public/plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="../../public/plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../public/css/main.css">
    <script src="../../public/libs/jquery.min.js"></script>
    <script src="../../public/plugins/layer/layer.js"></script>
    <script src="../../public/libs/bootstrap.min.js"></script>
    <script src="../../public/libs/vue.min.js"></script>
    <script src="../../public/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../public/plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="../../public/plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="../../public/js/common.js"></script>
    <!--<script type="text/javascript" src="../public/plugins/upload/jquery.js"></script>-->
    <script type="text/javascript" src="../../public/plugins/upload/ajaxfileupload.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.partnerName" @keyup.enter="query" placeholder="姓名">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <a v-if="hasPermission('sys:partner:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            <a v-if="hasPermission('sys:partner:saveAll')" class="btn btn-primary" @click="addBatch"><i class="fa fa-plus"></i>&nbsp;批量添加</a>
            <a v-if="hasPermission('sys:partner:update')" class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            <a v-if="hasPermission('sys:partner:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="showUpload" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <div v-show="showUploadList">
            <!--<span>dddd</span>-->
            <!--<table id="uploadExcelList"></table>-->
            <table class="table table-bordered table-hover">
                <!--<li>{{item}}</li>-->
                <thead>
                <tr id="listHeader" class="col">
                    <th><input type="checkbox" @click="checkAll" id="checkAll"/></th>
                    <th>编号</th>
                    <th>合作商</th>
                    <th>身份</th>
                    <th>身份证号码</th>
                    <th>公司类型</th>
                    <th>地区</th>
                    <th>编号</th>
                    <th>合同有效期</th>
                </tr>
                </thead>
                <tr v-for="(item,index) in uploadListPage.pageData" onclick="thClicked(this)" class="listContent">
                    <th><input type="checkbox"/></th>
                    <th>{{item.partnerId}}</th>
                    <th>{{item.partnerName}}</th>
                    <th>{{item.identity}}</th>
                    <th>{{item.idCard}}</th>
                    <th>{{item.company}}</th>
                    <th>{{item.address}}</th>
                    <th>{{item.number}}</th>
                    <th>{{item.expiryDate}}</th>
                </tr>
            </table>
            <nav>
                <ul class="pager">
                    <li class="previous disabled" id="pagePre"><a href="#" @click="uploadPrePage"><span aria-hidden="true">&larr;</span> 上一页</a></li>
                    <li>&nbsp;每页<input id="pageSizeValue" type="number" value="50" style="width: 50px;text-align: center"/>条&nbsp;</li>
                    <li>&nbsp;共{{partnerExcel.length}}条&nbsp;</li>
                    <li>&nbsp;第{{uploadListPage.currentPage}}页&nbsp;</li>
                    <li>&nbsp;共{{uploadListPage.pageCount}}页&nbsp;</li>
                    <li class="next" id="pageNext"><a href="#" @click="uploadNextPage">下一页 <span aria-hidden="true">&rarr;</span></a></li>
                </ul>
            </nav>
        </div>
        <form id="uploadForm" style="margin-top: 20px">
            <!--<div class="form-group col-sm-2">-->
                <!--<input   type="file" name="file"/>-->
                <!--<input type="button" value="上传" @click="uploadExcel"/>-->
            <!--</div>-->
            <div class="grid-btn">
                <div class="form-group col-sm-2">
                    <input id="fileToUpload" name="file" type="file" class="form-control file-input" placeholder="excel"/>
                </div>
                <a class="btn btn-default" @click="uploadExcel">上传</a>
                <span id="uploadError"></span>
            </div>
            <div class="form-group form-horizontal" style="margin-left: 8%">
                <input type="button" class="btn btn-primary" @click="saveAll" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

    <div v-show="showAdd" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">身份</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.identity" placeholder="身份"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">姓名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.partnerName" placeholder="姓名"/>
                    <span style="color: red">非合伙人请填写公司全称</span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">公司</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.company" placeholder="公司"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">身份证号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.idCard" placeholder="身份证号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">省份地址</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.address" placeholder="省份地址"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">类型</div>
                <div class="col-sm-10">
                    <!--<input type="text" class="form-control" v-model="partner.typed" placeholder="类型"/>-->
                    <select class="form-control"v-model="partner.typed" name="method" data-itemid="{{ $index }}">
                        <option v-for="option in options" v-bind:value="option.value">
                                {{ option.text }}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">编号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.number" placeholder="编号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">有效期</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.expiryDate" placeholder="有效期"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="partner.remake" placeholder="有效期"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="../../public/js/sys/partner.js"></script>
</body>
</html>